home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
common
/
calc_cop.c4
< prev
next >
Wrap
Text File
|
2002-09-09
|
1KB
|
42 lines
{
@calc_cop {
resid Player;
resid Game;
int nav_getting_pulled_over;
int chance_speeding_pullover;
int chance_chains_pullover;
int tmp_int;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
ResPropAlias(Game,"game_chance_chains_pullover","chance_chains_pullover");
ResPropAlias(Game,"game_chance_speeding_pullover","chance_speeding_pullover");
/* figure out if we should get a visit by the cops */
if (ResPropGetInt(Player,"truck_speeding") == 1) {
tmp_int = Random(0,chance_speeding_pullover);
}
if (tmp_int == 1 /* number pulled out of my bum */) {
ResPropSetInt(ResByName("dash.gl/SegmentController"),"state",9);
ResParseEvent(ResByName("dash.gl/brake_pedal"),"@activate");
stop;
}
if (( ResPropGetInt(Player,"truck_chains_on") == 1) &&
StrExact(ResPropGetStr(Player,"weather_weather"),"d") ) {
tmp_int = Random(0,chance_chains_pullover);
}
if (tmp_int == 1 /* number pulled out of my bum */) {
CVarSetInt("guiInputEnabled",0);
ResPropSetInt(ResByName("dash.gl/SegmentController"),"state",9);
ResParseEvent(ResByName("dash.gl/brake_pedal"),"@activate");
stop;
}
}
}